<%--
  Created by IntelliJ IDEA.
  User: 大飞飞
  Date: 2025/1/5
  Time: 16:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生信息管理系统</title>
    <!-- 引入Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 可选：引入Font Awesome图标 -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background: #f8f9fa;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .login-container {
            max-width: 400px;
            padding: 2rem;
            background-color: white;
            border-radius: 0.5rem;
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        }
        .login-form .form-control {
            border-radius: 2rem;
        }
        .btn-login {
            border-radius: 2rem;
            width: 100%;
        }
    </style>
</head>
<body>
<div class="container login-container">
    <div class="text-center mb-4">
        <h1 class="h3 mb-3 font-weight-normal">学生信息管理系统</h1>
        <% if (request.getAttribute("error") != null) { %>
        <p class="text-danger"><%= request.getAttribute("error") %></p>
        <% } %>
        <% if (session.getAttribute("successMessage") != null) { %>
        <p class="text-success"><%= session.getAttribute("successMessage") %></p>
        <% session.removeAttribute("successMessage"); %>
        <% } %>
    </div>
    <form action="doLogin" method="post" onsubmit="return loginVerify();">
        <div class="form-floating mb-3">
            <input type="text" class="form-control" id="username" name="username" placeholder="用户名" required>
            <label for="username">用户名</label>
        </div>
        <div class="form-floating mb-3">
            <input type="password" class="form-control" id="password" name="password" placeholder="密码" required>
            <label for="password">密码</label>
        </div>
        <button class="btn btn-lg btn-primary btn-login" type="submit">登录</button>
        <p class="mt-5 mb-3 text-muted">&copy; 湖南大众传媒职业技术大学</p>
        <p class="mb-3 text-center"><a href="register.jsp" class="text-decoration-none">注册新账号</a></p>
    </form>
</div>

<!-- 引入Bootstrap JS和Popper.js -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"></script>
</body>
</html>